package util

/*
*
通过指定顺序返回map的值
*/
func sortMap[T any](sort []string, m map[string]T) []T {
	if m == nil || len(m) == 0 {
		return nil
	}
	result := make([]T, len(m))
	if sort == nil || len(sort) == 0 {
		for _, value := range m {
			// 输出键和值
			result = append(result, value)
		}
	} else {
		for _, v := range sort {
			result = append(result, m[v])
		}
	}
	return result
}
